# -*- encoding: utf-8 -*-
CUSTOM_SERVICE_ANALYSIS_CONFIG = {
    'group_by': '_agent_id',
    'real_time_report': False,
    'interval_type_list': ['day'],
    'target_event_id': ['apply_child_agent', 'apply_page_entrance', 'approve_child_agent'],
    'values': [
        {
            "value_id": "apply_page_visit_count",
            "target_value": "_ip.keyword",
            "value_name": "链接点击数",
            "filter": [
                {'term': {'_event_id': 'apply_page_entrance'}}
            ],
            "operation": "cardinality"
        },
        {
            "value_id": "apply_child_agent_count",
            "target_value": "_agent_id",
            "value_name": "代理注册数",
            "filter": [
                {'term': {'_event_id': 'apply_child_agent'}},
            ],
            "operation": "value_count"
        },
        {
            "value_id": "apply_child_agent_approve_count",
            "target_value": "_agent_id",
            "value_name": "代理开通数",
            "filter": [
                {'term': {'_event_id': 'approve_child_agent'}},
                {'term': {'approve_child_agent_result': 'approved'}}
            ],
            "operation": "value_count"
        }

    ]
}

